<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <ul>
            <!-- 括弧里面的顺序不能颠倒, (x,y)  -->
            <!-- x: 遍历的数组元素 - y: 默认的索引 -->
            <li v-for="(item,index) in lists">
                {{ index + 1 }} - {{ item.name }}
            </li>
        </ul>
    </div>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        let app = new Vue({
            el: '#app',
            data(){
                return {
                    lists: [
                        {
                            id: 1,
                            name: '伟强'
                        },
                        {
                            id: 2,
                            name: '拥有'
                        },
                        {
                            id: 3,
                            name: '抽丝剥茧'
                        },
                        {
                            id: 4,
                            name: '困死'
                        }
                    ]
                }
            }
        })
    </script>
</body>
</html>